//
//  ActivityTableViewCell.m
//  DoubanDemo1
//
//  Created by lanou3g on 15/11/20.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "ActivityTableViewCell.h"
#import "ILView.h"
//#import "ActivityList.h"


@implementation ActivityTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self allViews];
    }
    return self;
}

- (void)allViews
{
    
    self.bigBackgroundImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bg_eventlistcell@2x.png"]];
    self.bigBackgroundImageView.frame = CGRectMake(37, 0, 300, 140);
    [self.contentView addSubview:self.bigBackgroundImageView];
    
    //titleLabel
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, 0, 180, 30)];
    [self.bigBackgroundImageView addSubview:self.titleLabel];

    //
    self.smallBackgroundImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bg_share_large@2x.png"]];
    self.smallBackgroundImageView.frame = CGRectMake(10, 30, 280, 100);
    [self.bigBackgroundImageView addSubview:self.smallBackgroundImageView];
    //
    self.topILView = [[ILView alloc]initWithFrame:CGRectMake(10, 0, 180, 25)];
    [self.smallBackgroundImageView addSubview:self.topILView];
    //
    self.middleILView = [[ILView alloc]initWithFrame:CGRectMake(10, 25, 180, 25)];
    self.middleILView.leftImageView.image = [UIImage imageNamed:@"icon_spot@2x"];
    [self.smallBackgroundImageView addSubview:self.middleILView];
    
    //
    self.downILView = [[ILView alloc]initWithFrame:CGRectMake(10, 50, 180, 25)];
    self.downILView.leftImageView.image = [UIImage imageNamed:@"icon_catalog@2x"];
    [self.smallBackgroundImageView addSubview:self.downILView];
    
    //
    self.wisherCountLabel1 = [[UILabel alloc]initWithFrame:CGRectMake(10, 75, 45, 25)];
    [self.smallBackgroundImageView addSubview:self.wisherCountLabel1];
    //
    self.wisherCountLabel2 = [[UILabel alloc]initWithFrame:CGRectMake(55, 75, 45, 25)];
    [self.smallBackgroundImageView addSubview:self.wisherCountLabel2];
    //
    self.participantCountLabel1 = [[UILabel alloc]initWithFrame:CGRectMake(100, 75, 45, 25)];
    [self.smallBackgroundImageView addSubview:self.participantCountLabel1];
    //
    self.participantCountLabel2 = [[UILabel alloc]initWithFrame:CGRectMake(145, 75, 45, 25)];
    [self.smallBackgroundImageView addSubview:self.participantCountLabel2];
    
    self.activityImageView = [[UIImageView alloc]init];
    self.activityImageView.frame = CGRectMake(190, -15, 90, 110);
    [self.smallBackgroundImageView addSubview:self.activityImageView];
    
}


//- (void)setActivityList:(ActivityList *)activityList
//{
//    self.titleLabel.text = activityList.title;
//    
//    
//    NSString *timeStr = [NSString stringWithFormat:@"%@ %@",activityList.begin_time,activityList.end_time];
//    
//    self.topILView.rightLabel.text = timeStr;
//    self.topILView.rightLabel.font = [UIFont fontWithName:nil size:10];
//    self.topILView.rightLabel.adjustsFontSizeToFitWidth = YES;
//    //self.topILView.rightLabel.numberOfLines = 0;
//    
//    self.middleILView.rightLabel.text = activityList.address;
//    self.middleILView.rightLabel.font = [UIFont fontWithName:nil size:13];
//    
//    NSString *typeStr = [NSString stringWithFormat:@"类型： %@",activityList.category_name];
//    self.downILView.rightLabel.text = typeStr;
//    
//    self.downILView.rightLabel.font = [UIFont fontWithName:nil size:13];
//    
//    self.wisherCountLabel1.text = @"感兴趣";
//    self.wisherCountLabel1.font = [UIFont fontWithName:nil size:13];
//
//    NSString *wisher_countStr = [NSString stringWithFormat:@"%ld",activityList.wisher_count];
//    self.wisherCountLabel2.font = [UIFont fontWithName:nil size:13];
//    self.wisherCountLabel2.text = wisher_countStr;
//    
//    self.participantCountLabel1.text = @"参加";
//    self.participantCountLabel1.font = [UIFont fontWithName:nil size:13];
//    NSString *participant_countStr = [NSString stringWithFormat:@"%ld",activityList.participant_count];
//    self.participantCountLabel2.font = [UIFont fontWithName:nil size:13];
//    self.participantCountLabel2.text = participant_countStr;
//    
//    NSURL *imageUrl = [[NSURL alloc]initWithString:activityList.image];
//    NSData *imageData = [NSData dataWithContentsOfURL:imageUrl];
//    self.activityImageView.image = [UIImage imageWithData:imageData];
//}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
